package com.vf.admin.client.dao;

import com.vf.admin.common.db.BaseDao;
import com.vf.admin.common.splitpage.SplitPageBean;
import com.vf.admin.miaodong.entity.AppGiftNum;
import com.vf.admin.utils.StringEx;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * 礼物数量
 * @author anxiang
 * @version 1.0.0
 * @ClassName AppGiftNumDao.java
 * @Description TODO
 * @createTime 2021年07月23日 16:57:00
 */
@Repository
public class AppGiftNumDao extends BaseDao<AppGiftNum>{

    /**
     * 查询列表
     */
    public List<AppGiftNum> list(Map<String,Object> paraMap, SplitPageBean splitPage) {
        ArrayList<Object> paramList = new ArrayList<Object>();
        StringBuilder sbStr = new StringBuilder("select * from app_gift_num where 1=1  ");

        sbStr.append(" order by num asc");
        String sql = sbStr.toString();
        return this.queryList(sql,paramList, AppGiftNum.class,splitPage);
    }

    //详情
    public AppGiftNum get(Integer id){
        if (StringEx.isNullOrLing(id)) {
            return null;
        }
        List<Object> paramList = new ArrayList<Object>();
        StringBuilder sbStr = new StringBuilder(" select * from app_gift_num where 1=1");
        sbStr.append(" and id = ? ");
        paramList.add(id);
        String sql = sbStr.toString();
        return this.queryObj(sql, paramList, AppGiftNum.class);
    }
}
